package qa.ui;

import javax.swing.JPanel;
import javax.swing.JLabel;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.JRadioButton;
import javax.swing.JButton;
import javax.swing.ButtonGroup;

import java.awt.event.ActionEvent;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class LoginScreen extends JPanel {
	private JLabel lblLogin;
	private JButton btnBack;
	private JButton btnForward;
	
	private String customer;
	private JPasswordField passwordField;
	private JTextField usernameField;

	/**
	 * Create the panel.
	 */
	public LoginScreen() {
		setLayout(null);
		
		lblLogin = new JLabel("Login");
		lblLogin.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblLogin.setBounds(146, 11, 161, 30);
		add(lblLogin);
		
		btnBack = new JButton("<");
		btnBack.setBounds(90, 191, 89, 23);
		add(btnBack);
		
		btnForward = new JButton(">");
		btnForward.setBounds(269, 191, 89, 23);
		add(btnForward);
		
		JLabel lblUsername = new JLabel("Username");
		lblUsername.setBounds(61, 87, 76, 23);
		add(lblUsername);
		
		JLabel lblPassword = new JLabel("Password");
		lblPassword.setBounds(61, 135, 68, 23);
		add(lblPassword);
		
		passwordField = new JPasswordField();
		passwordField.setBounds(164, 132, 76, 28);
		
//		Umiddelbart har koden ingen funktion. Udkommenteret til eventuelt senere brug.
//		passwordField.addActionListener(
//				new ActionListener(){
//					public void actionPerformed(ActionEvent event){	
//						
//						
//					}
//				}	
//			);
		
		usernameField = new JTextField();
		usernameField.setBounds(164, 84, 76, 28);
		usernameField.setColumns(10);
// 		Umiddelbart har koden ingen funktion. Udkommenteret til eventuelt senere brug.
//		usernameField.addActionListener(
//				new ActionListener(){
//					public void actionPerformed(ActionEvent event){	
//				
//					}	
//				}	
//			);
		
		add(passwordField, BorderLayout.NORTH);
		add(usernameField, BorderLayout.NORTH);
	}
	
	public String getCustomer() 
	{
		return customer;
	}

	public JButton getBtnForward() 
	{
		return btnForward;
	}

	public void addActionListener(ActionListener l) 
	{
		btnBack.addActionListener(l);
		btnForward.addActionListener(l);
	//	usernameField.addActionListener(l);
	//	passwordField.addActionListener(l);
	}
	
	public JPasswordField getPasswordField() 
	{ 
	return passwordField; 
	}

    public JTextField getUsernameField() {
    return usernameField;	
    }
    
}
